<script>
export default {
  name: 'ButtonGroup',
  props: {
    button: {
      type: Array,
      default: () => ['save', 'next', 'prev', 'genProject']
    },
    paddingTop: {
      type: String,
      default: '0px'
    }
  },
  render(h) {
    const btnList = {}
    btnList.save = h('Button', { attrs: { type: 'primary' }, on: { click: () => this.$emit('save') }}, '保存')
    btnList.next = h('Button', { attrs: { type: 'primary' }, on: { click: () => this.$emit('next') }}, '下一步')
    btnList.prev = h('Button', { attrs: { type: 'primary' }, on: { click: () => this.$emit('prev') }}, '返回上一步')
    btnList.genProject = h('Button', { attrs: { type: 'primary' }, on: { click: () => this.$emit('genProject') }}, '生成项目')
    return h('div', { class: 'button-container', style: { paddingTop: this.paddingTop }}, this.button.map(e => btnList[e]))
  }
}
</script>
